<!DOCTYPE html>
<html>
  <head>
    <title>修改信息</title>
	<include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
	</style>
</head>
<body>

<div class="layui-tab">
<form class="layui-form" id="f" method="post" >

  <label class="layui-form-label" style="font-size:20px">基本信息</label>
  <input type="hidden" name="id" value="{$data.id}">
  <table class="layui-table layui-nomargin" style="text-align: center;margin-top:20px">
    <tr>
      <td>快递公司名称</td>
      <td>
        <input type="text" name="company"  class="layui-input" required="" value="{$data.company}">
      </td>
    </tr>
    <tr>
      <td>快递公司编码</td>
      <td>
        <input type="text" name="code"  class="layui-input" required="" value="{$data.code}">
      </td>
    </tr>
  </table>

</form>
</div>
</body>

<include file="public/scripts"/>
<script>
  
    var tijiao = function(){

    if($("input[id='company']").val() == ''){
      layer.msg('请输入快递公司名称');
      return false;
    }
    if($("input[id='code']").val() == ''){
      layer.msg('请输入快递公司编码');
      return false;
    }

    var dara = $("#f").serialize();

    $.ajax({
      url:"{:cmf_plugin_url('logistics://admin_index/editPage')}",
      data:dara,
      type:'post',
      success:function(data){
        if (data.code == 200) {
          layer.msg(data.message,{icon:1,time:1500},function(){
            parent.layer.closeAll();
            parent.location.reload(); 
          });
        } else {
          layer.msg(data.message,{icon:2,time:1500});
        }
      },
      error:function()
      {
        layer.msg('系统错误',{icon:2,time:1500});
      }
    })
    }
</script>
</html>